<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.9.1"/>
<title>knet: 广播</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { init_search(); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">knet
   &#160;<span id="projectnumber">1.4.5</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.9.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>首页</span></a></li>
      <li><a href="modules.html"><span>模块</span></a></li>
      <li><a href="annotated.html"><span>结构体</span></a></li>
      <li><a href="files.html"><span>文件</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="搜索" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">函数</a>  </div>
  <div class="headertitle">
<div class="title">广播</div>  </div>
</div><!--header-->
<div class="contents">

<p>广播域  
<a href="#details">更多...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
函数</h2></td></tr>
<tr class="memitem:ga41a1258d2f4ae75120f26ab7f2326111"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00056_a1b551151864af85fa6cce57058153d04.html#a1b551151864af85fa6cce57058153d04">kbroadcast_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00112_ga41a1258d2f4ae75120f26ab7f2326111.html#ga41a1258d2f4ae75120f26ab7f2326111">knet_broadcast_create</a> ()</td></tr>
<tr class="memdesc:ga41a1258d2f4ae75120f26ab7f2326111"><td class="mdescLeft">&#160;</td><td class="mdescRight">创建广播域  <a href="a00112_ga41a1258d2f4ae75120f26ab7f2326111.html#ga41a1258d2f4ae75120f26ab7f2326111">更多...</a><br /></td></tr>
<tr class="separator:ga41a1258d2f4ae75120f26ab7f2326111"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga4b13b2545278c2324f4171ef0bbf990a"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00112_ga4b13b2545278c2324f4171ef0bbf990a.html#ga4b13b2545278c2324f4171ef0bbf990a">knet_broadcast_destroy</a> (<a class="el" href="a00056_a1b551151864af85fa6cce57058153d04.html#a1b551151864af85fa6cce57058153d04">kbroadcast_t</a> *broadcast)</td></tr>
<tr class="memdesc:ga4b13b2545278c2324f4171ef0bbf990a"><td class="mdescLeft">&#160;</td><td class="mdescRight">销毁广播域  <a href="a00112_ga4b13b2545278c2324f4171ef0bbf990a.html#ga4b13b2545278c2324f4171ef0bbf990a">更多...</a><br /></td></tr>
<tr class="separator:ga4b13b2545278c2324f4171ef0bbf990a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga1355d3863db663680b1c74363d3a5745"><td class="memItemLeft" align="right" valign="top"><a class="el" href="a00056_a3b7e82599367eade261456f60ebe2cd9.html#a3b7e82599367eade261456f60ebe2cd9">kchannel_ref_t</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00112_ga1355d3863db663680b1c74363d3a5745.html#ga1355d3863db663680b1c74363d3a5745">knet_broadcast_join</a> (<a class="el" href="a00056_a1b551151864af85fa6cce57058153d04.html#a1b551151864af85fa6cce57058153d04">kbroadcast_t</a> *broadcast, <a class="el" href="a00056_a3b7e82599367eade261456f60ebe2cd9.html#a3b7e82599367eade261456f60ebe2cd9">kchannel_ref_t</a> *channel_ref)</td></tr>
<tr class="memdesc:ga1355d3863db663680b1c74363d3a5745"><td class="mdescLeft">&#160;</td><td class="mdescRight">加入广播域  <a href="a00112_ga1355d3863db663680b1c74363d3a5745.html#ga1355d3863db663680b1c74363d3a5745">更多...</a><br /></td></tr>
<tr class="separator:ga1355d3863db663680b1c74363d3a5745"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga3bb02208a76f18bb2eee61955b3781cd"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00112_ga3bb02208a76f18bb2eee61955b3781cd.html#ga3bb02208a76f18bb2eee61955b3781cd">knet_broadcast_leave</a> (<a class="el" href="a00056_a1b551151864af85fa6cce57058153d04.html#a1b551151864af85fa6cce57058153d04">kbroadcast_t</a> *broadcast, <a class="el" href="a00056_a3b7e82599367eade261456f60ebe2cd9.html#a3b7e82599367eade261456f60ebe2cd9">kchannel_ref_t</a> *channel_ref)</td></tr>
<tr class="memdesc:ga3bb02208a76f18bb2eee61955b3781cd"><td class="mdescLeft">&#160;</td><td class="mdescRight">离开广播域  <a href="a00112_ga3bb02208a76f18bb2eee61955b3781cd.html#ga3bb02208a76f18bb2eee61955b3781cd">更多...</a><br /></td></tr>
<tr class="separator:ga3bb02208a76f18bb2eee61955b3781cd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gabf0b20b2490b3508e58a77314812f1a5"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00112_gabf0b20b2490b3508e58a77314812f1a5.html#gabf0b20b2490b3508e58a77314812f1a5">knet_broadcast_get_count</a> (<a class="el" href="a00056_a1b551151864af85fa6cce57058153d04.html#a1b551151864af85fa6cce57058153d04">kbroadcast_t</a> *broadcast)</td></tr>
<tr class="memdesc:gabf0b20b2490b3508e58a77314812f1a5"><td class="mdescLeft">&#160;</td><td class="mdescRight">取得广播域内管道数量  <a href="a00112_gabf0b20b2490b3508e58a77314812f1a5.html#gabf0b20b2490b3508e58a77314812f1a5">更多...</a><br /></td></tr>
<tr class="separator:gabf0b20b2490b3508e58a77314812f1a5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gafd3ac5d785687d729047a51724104060"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00112_gafd3ac5d785687d729047a51724104060.html#gafd3ac5d785687d729047a51724104060">knet_broadcast_write</a> (<a class="el" href="a00056_a1b551151864af85fa6cce57058153d04.html#a1b551151864af85fa6cce57058153d04">kbroadcast_t</a> *broadcast, char *buffer, uint32_t size)</td></tr>
<tr class="memdesc:gafd3ac5d785687d729047a51724104060"><td class="mdescLeft">&#160;</td><td class="mdescRight">广播  <a href="a00112_gafd3ac5d785687d729047a51724104060.html#gafd3ac5d785687d729047a51724104060">更多...</a><br /></td></tr>
<tr class="separator:gafd3ac5d785687d729047a51724104060"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">详细描述</h2>
<p>广播域 </p>
<pre>
管道可以加入广播域，加入后通过knet_broadcast_write方法可以发送数据到所有已经加入域内的管道.
调用knet_broadcast_create创建一个广播域，knet_broadcast_destroy销毁广播域.</pre><pre>knet_broadcast_join加入一个广播域，knet_broadcast_join函数返回时创建了一个新的管道引用.</pre><pre>调用knet_broadcast_leave时应该使用这个返回值而不是使用knet_broadcast_join的第二个参数，新创建
的管道引用会提升管道的引用计数，如果你关闭了这个管道你可以通过调用knet_broadcast_leave减少管
道的引用计数，从而可以让kloop_t真正销毁管道.</pre><pre>调用knet_broadcast_get_count可以得知广播域内的管道引用数量，调用knet_broadcast_write发起一个
广播操作，所有域内管道都会收到你广播的数据.
</pre> </div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
生成于 2015年 七月 27日 星期一 14:33:20 , 为 knet使用  &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.9.1
</small></address>
</body>
</html>
